﻿function Send()
{
    showProgressBar(true);
    WebServices.My.Send(memberno,onsucc);
}
 function NewSend()
 {
     $('newDiv').style.display="";
 }
 function Save()
 {
    $get("btnSave").disabled = true;
    showProgressBar(true);
    WebServices.My.UpdateEmail(memberno,$("newEmail").value,onsucc1);
 }
 function onsucc1(result)
 { 
    if(result[0]==1)
    {
     
        $('showemail').innerHTML=UR053.replace(/\{0\}/gi,$('newEmail').value);
        $('newEmail').value='';
        $get("btnSave").disabled = false;
        showProgressBar(false);
        $("MessagesBox").style.display='';
        $("MessageImg").src = MessageImageF;
        $("MessageText").innerHTML = C1002;
        $('newDiv').style.display='none';
        $('return_mail').innerHTML=result[1];
        WebServices.My.Send(memberno); 
        return;
    }
    else
    {   
        $get("btnSave").disabled = false;
        showProgressBar(false);
        $get("MessagesBox").style.display='';
        $get("MessageImg").src = MessageImageF;
        $get("MessageText").innerHTML = busy; 
    }
    
 }
function onsucc(result)
 {
  if(result)
  {
     $get("MessagesBox").style.display='';
        $get("MessageImg").src = MessageImageF;
        $get("MessageText").innerHTML = hit;
        var heer=top.location+""; 
        if(heer.indexOf("registercomplete")<-1)
        { 
         $get("send").innerHTML='';
        }

  }
  else
  {
        $get("MessagesBox").style.display='';
        $get("MessageImg").src = MessageImageF;
        $get("MessageText").innerHTML = busy;
  }
   showProgressBar(false);
 }
 function conceal(a)
{
if(a=='sMemberCrtNo')
{
$('RMemberCrtNo').style.display="none";
 $('imgemail').src="/Images/loading.gif" ;
$('imgemail').style.display="";
var re = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
 if($get("newEmail").value.search(re))
 {
    $('RMemberCrtNo').style.display=""; 
    $('imgemail').style.display="none"; 
    return;
}else
{
  WebServices.My.ValiEmail($('newEmail').value,onsucc2);
  }  
}
}
function onsucc2(result)
{
    if(result==1)
    {
       $('imgemail').src="/Images/action_delete.gif" ;
       $('RMemberCrtNo').style.display="";
       $('RMemberCrtNo').innerHTML="<br />"+UR018
    }else if(result==2)
    {
        $('imgemail').src="/Images/action_stop.gif" ;
        $('RMemberCrtNo').style.display="";
        $('RMemberCrtNo').innerHTML=busy;
    } else if(result==0)
    {
        $('imgemail').src="/Images/action_check.gif" ;
    }
}
